﻿using Max.PH4.Shoppgin.Admin.Domain;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Max.PH4.Shoppgin.Admin.IRespository
{

    /*
     * 接口：
     * 1、只定义方法，不实现
     * 2、默认所有的方法修饰符，都是public的
     * 3、接口不能被实例化，只能实例化它的实现类
     * **/

    /// <summary>
    /// 系统用户的仓储接口
    /// </summary>
    public interface ISystemUserRespository
    {
        /// <summary>
        /// 添加一条数据到数据库
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
       int Insert(SystemUserEntity entity);

        /// <summary>
        /// 修改数据
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        int Update(SystemUserEntity entity);

        /// <summary>
        /// 根据实体删除一条数据 
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        int Delete(SystemUserEntity entity);

        /*
         * object是一切类的基类
         * **/
        /// <summary>
        /// 根据ID删除一条数据       
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        int Delete(object id);

        /// <summary>
        /// 查询所有数据
        /// </summary>
        /// <returns></returns>
        IQueryable<SystemUserEntity> Query();
    }
}
